import React from 'react'

function Son(props) {

    let { arr, str, parentbtn } = props

    const onchange = () => {
        parentbtn([4, 5, 6, 7, 8])
    }

    const style = {
        color : 'red',
        padding : '5px 10px',
    }
    return (
        <div>Son
            {str}

            {
                arr.map((item, index) => (<span key={index}>{item}</span>))
            }

            <button onClick={onchange} 
                style={style}>parent</button>

            <span style={{color:'red'}}>样式</span>
        </div>
    )
}

export default Son